<?php

namespace App\Http\Controllers;
use App\Models\Category;
use App\Models\Traits\ActiveUsersCounter;


class RootController extends Controller {
    use ActiveUsersCounter;
    public function __construct() {
        $this->middleware('signed')->only(['meeting']);
    }

    public function root() {
        $categories = Category::all();
        return view('pages.root',compact('categories'));
    }

    public function permissionDenied(){
        if(config('administrator.permission')()){
            return redirect(url(config('administrator.uri'),302));
        }
        return view('pages.permission_denied');
    }
}
